﻿using System.Collections.Generic;
using System.ComponentModel.Composition;
using InvestmentIntelligence.SchedulingService.Infrastructure;
using InvestmentIntelligence.TradingData.DataProcessing.Processing;
using InvestmentIntelligence.TradingData.Handlers.Handlers.MissedDataHandlers;

namespace InvestmentIntelligence.TradingData.Handlers.Mus
{
    [Export(typeof(IScheduledTaskFactory))]
    [ExportMetadata("TaskName", "PopulateCloseExposureInPositions")]
    public class DbMusPopulateCloseExposureInOriginalPositionsHandlerFactory : FolderBasedHandlerFactoryBase, IScheduledTaskFactory
    {
        public override IEnumerable<ScheduledTaskParameter> GetParameters()
        {
            return new LinkedList<ScheduledTaskParameter>();
        }

        public override IScheduledTask CreateTask(CreateTaskParams createTaskParams, IDictionary<ScheduledTaskParameter, string> arguments)
        {
            return new PopulateMissedCloseExposureInPositionHandler(new SecurityResolver(SecurityResolver.AllIdentities, new UnresolvedSecurityWriter()));
        }
    }
}